package com.zhouyu.exampleThread.proAndComsu;

import java.util.ArrayList;
import java.util.List;

import lombok.Data;

/**
 * @Description:
 */
@Data
public class FruitFactory {

  public static int max=100;

  private volatile List<String> list;

  public void addFruit(String fruit){
    list.add(fruit);
  }

  public void remove(){
    if(list.size()>0){
      list.remove(0);
    }
  }

  public FruitFactory() {
    this.list = new ArrayList<>(10);
  }

  public boolean isfull(){
    return list.size()>100;
  }
}
